<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <style>
      thead{
          background-color: #9999;
      }
     #btn{
          background-color: blueviolet;
          color:white;
          border: none;
          text-align: center; 
       
      }
      #del{
        background-color: rgb(181, 176, 185);
          color:white;
          border: none;
          text-align: center;
       
      }
      td{
          width: 200px;
          text-align: center;
      }
      p{
          margin: auto;
      }
</style>
    <table id="tab">
        <thead>
            <td>姓名</td>
            <td>性别</td>
            <td>年龄</td>
            <td>电话</td>
            <td>操作</td>
        </thead>
        <tbody id="tbody">
            <tr>
                <td>大大怪</td>
                <td>男</td>
                <td>200</td>
                <td>123456</td>
                <td><button id="del">删除</button></td>
            </tr>
            <tr>
                
                <td>小小怪</td>
                <td>男</td>
                <td>150</td>
                <td>12305</td>
                <td><button id="del">删除</button></td>
            </tr>
          
           
            
        </tbody>
       
    </table>
    <p>
        <button id="btn">添加</button>
       </p>
</body>
<script>
    
        btn.onclick = function(){
            
   
        var tr = document.createElement('tr')
        tr.innerHTML = '<td><input type="text"></td><td><input type="text"></td><td><input type="text"></td><td><input type="text"></td><td><button id="del">删除</button></td>'
        var td = document.getElementsByTagName('table')[0]
               td.appendChild(tr,td.childNodes[0])
    }
       del.onclick = function(){
        var tr =document.getElementsByTagName('table')[0]
               tbody.removeChild(this.parentNode.parentNode)
       }

</script>
</html>